<?php $this->load->view('admin/forms/works_form');?>
                <?php echo validation_errors(); ?>
                <div id="search">
                   <?php echo validation_errors(); ?>
                   <?php  echo form_open('admin/works');// var_dump($categories); ?>
                            <div id="input_search">
                                <b>Site :</b>
                                <select name="id_site"> 
                                    <option value="0" selected>--Any--</option>
                                    <?php   foreach($categories as $item): ?>
                                    <option value="<?php echo $item['id'] ?>"><?php echo $item['name'] ?></option>
                                    <?php  endforeach; ?>
                                </select>
                                &nbsp;
                                <b>Products </b>
                                <input type="text" name="keyword" value="<?php if (isset($_GET['keyword'])) echo $_GET['keyword'];?>">
                                <input type="submit" name="search" value="Search">
                            </div>
                    </form>
                </div><!-- End #search; -->
                <div class="total_pagination">
                        <div id="show_search" class="float_left">
                                <b>Total :&nbsp;</b>
                                About <?php echo $total ?> result.
                        </div>
                        <div id="pagination" class="float_right">
                            <?php echo "pagination" ?>
                        </div>
                        <div class="clear"></div>
                </div>
                <div class="show_data">
                    <table cellspacing="0" cellpadding="5" border="0" width="100%">
                        <tr>
                            <td align="center" colspan="10" valign="middle" class="title" style="padding: 15px;">WORKS</td>
                        </tr>
                        <tr>
                            <td class="title"><a href=""></a>Name</td>
                            <td class="title">Images</td>
                            <td class="title">Description</td>
                            <td class="title">Type</td>
                            <td class="title"> &nbsp; Operation &nbsp; </td>            
                        </tr>
                        <?php if (!empty($products)): $count = 0; ?>
                            <?php foreach ($products as $item): $count++; ?>
                                <tr <?php if ($count % 2 != 0) echo "class='enable'"; ?>>
                                    <td class="name"><a href="<?php echo '#'; ?>" target="_blank"><?php echo $item["name"]; ?></a></td>
                                    <td class="infor_show"><img src='<?php echo base_url($item["image"]); ?>' width="100px" height="100px"/></td>
                                    <td class="infor_show"><?php echo substr($item["description"], 0, 200); ?></td>
                                    <td class="infor_show"><?php echo $categories[$item["type"]-1]['name'];?></td>
                                    <td class="infor_show"> 
                                        <a href="view_works?id=<?php echo $item["id"]; ?>&action=<?php echo md5('edit_works');?>" class="edit" title="edit work"> Edit</a>
                                        <a href="view_works?id=<?php echo $item["id"]; ?>&action=<?php echo md5('view_works');?>" class="view" title="view work"> View</a>
                                        <a href="control_operation_works?id=<?php echo $item["id"]; ?>&action=<?php echo md5('delete_works');?>" class="delete" title="delete work"> Delete</a>
                                    </td>   
                                </tr>
                            <?php endforeach; ?>
                        <?php else : ?>
                            <div class='notice'>Not find works</div>
                        <?php endif; ?>
                    </table>
                </div><!-- End: #show_work -->